package com.tocean.app.controller.app;

import com.tocean.app.controller.framework.request.QuestionSaveRequest;
import com.tocean.app.controller.framework.search.QuestionSearchDto;
import com.tocean.app.dto.request.BasePageRequest;
import com.tocean.app.dto.request.BaseRequest;
import com.tocean.app.dto.response.BasePageResponse;
import com.tocean.app.dto.response.BaseResponse;
import com.tocean.app.entity.framework.Question;
import com.tocean.app.service.framework.QuestionService;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@Api(tags = "题目")
@Slf4j
@Validated
@CrossOrigin
@RestController("AppWechatQuestionController")
@RequestMapping("/app/wechatQuestion")
public class WechatQuestionController {

    @Autowired
    private QuestionService service;

    /**
     * 功能描述：获取题目
     *
     * @return
     */
    @CrossOrigin
    @ApiOperation(value = "获取题目")
    @GetMapping ("/findOne")
    public ResponseEntity<BaseResponse<Question>> findOne() {
        return ResponseEntity.ok(BaseResponse.ok(service.findOne()));
    }


}
